<template>
    <div id="discover">
         发现页面
         <button @click="goback()">返回</button>
         <fieldset>
             <legend>购物车</legend>
             <ul>
                <li v-for="(item,index) of $store.state.dataC" :key="index">
                    {{item.title}}
                </li>
             </ul>
         </fieldset>
    </div>
</template>

<script>
export default {
  methods:{
    goback(){
        this.$router.push("/home")
    }
  },
  mounted(){
    //调用actions
    this.$store.dispatch("commit");
    this.$store.state.name="discover已经修改完毕"
  }
}
</script>

<style>

</style>